package cloudlean.zuul.filter;

import lombok.Data;

/**
 * Created by eric on 2018/4/12.
 */
@Data
public class MdlResponseBody {
    /**
     * 响应码
     */
    private String code;
    /**
     * 信息，例如：错误信息
     */
    private String msg;
    private Object data;

    public MdlResponseBody(ResponseCode responseCode, Object data) {
        this(responseCode.getCode(), "", data);
    }

    public MdlResponseBody(ResponseCode responseCode, String msg) {
        this(responseCode.getCode(), msg, null);
    }

    public MdlResponseBody(String code, String msg) {
        this(code, msg, null);
    }

    public MdlResponseBody(ResponseCode code, String msg, Object data) {
        this(code.getCode(), msg, data);
    }

    public MdlResponseBody(String code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}
